function setTargets() {
  if (document.getElementsByTagName) {
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
      var anchor = anchors[i];
      if (anchor.getAttribute("href")) {
        var location = anchor.getAttribute("href");
        if ((location.indexOf("gpureview") == -1) && (location.indexOf("http://") != -1) && (location.indexOf("javascript") == -1)) anchor.target = "_blank";
      }
    }
  }
};

function loadMailtos() {
  if (document.getElementsByTagName) {
    var spans = document.getElementsByTagName("span");
    for (var i = 0; i < spans.length; i++) {
      var span = spans[i];
      if (span.className == 'mailto') {
        span.innerHTML = '<a href="mailto:' + span.id + '@gpureview.com">' + span.innerHTML + '</a>';
      }
    }
  }
};

function gpuLoad() {
  setTargets();
  loadMailtos();
};

window.onload = gpuLoad;

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object
function findPosX(obj) {
  var curleft = 0;
  if (obj.offsetParent) {
    while (obj.offsetParent) {
      curleft += obj.offsetLeft
      obj = obj.offsetParent;
    }
  } else if (obj.x) {
    curleft += obj.x;
  }
  return curleft;
}
function findPosY(obj) {
  var curtop = 0;
  if (obj.offsetParent) {
    while (obj.offsetParent) {
      curtop += obj.offsetTop
      obj = obj.offsetParent;
    }
  } else if (obj.y) {
    curtop += obj.y;
  }
  return curtop;
}
function Delegate() {}
Delegate.create = function (o, f) {
  var a = new Array();
  var l = arguments.length;
  for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i];
  return function() {
    var aP = [].concat(arguments, a);
    f.apply(o, aP);
  }
}